<%DIRECTIVE DYNAMIC;%>
<div class="modal-header">
	<button type="button" class="close" data-dismiss="modal" aria-label="Close">
		<span aria-hidden="true">&times;</span>
	</button>
	<h5 class="modal-title" >修改</h5>
</div>

            <form id="eidtForm" role="form" class="form-horizontal parsley-form" data-parsley-validate action="${base}/platform/enroll/product/editDo" method="post">
               	<div class="modal-body ">
               	<input id="id" name="id" value="${obj.product.id!}" type="hidden">
               	<input id="createAt" name="createAt" value="${obj.product.createAt!}" type="hidden">
               	<input id="createBy" name="createBy" value="${obj.product.createBy!}" type="hidden">
                <div class="row mb10">
                    <div class="col-lg-12">
                   		<div class="form-group">
                            <label for="region_id" class="col-sm-2 control-label">选择片区</label>
							
                            <div class="col-sm-8">
                                <select id="region_id" name="region_id" class="form-control" required="required">
                                	<%for(region in obj.regions){%>
                                		 <option value="${region.id}" <% if(obj.product.region_id==region.id){ %> selected="selected" <% } %>>${region.name}</option>
                                	<%}%>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="name" class="col-sm-2 control-label">名称</label>

                            <div class="col-sm-8">
                                <input type="text" id="name" class="form-control" name="name" data-parsley-required="true" placeholder="名称" value="${obj.product.name}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="code" class="col-sm-2 control-label">编号</label>

                            <div class="col-sm-8">
                                <input type="text" id="code" class="form-control" name="code" data-parsley-required="true" placeholder="编号" value="${obj.product.code}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="price" class="col-sm-2 control-label">价格</label>
                            
                            <div class="col-sm-8">
                                <input type="text" id="price" class="form-control" name="price" data-parsley-required="true"  placeholder="价格" value="${obj.product.price}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="specs" class="col-sm-2 control-label">产品规格</label>
                            
                            <div class="col-sm-8">
                                <input type="text" id="specs" class="form-control" name="specs" data-parsley-required="true"  placeholder="产品规格"  value="${obj.product.specs}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="payment" class="col-sm-2 control-label">付款说明</label>
                            
                            <div class="col-sm-8">
                                <input type="text" id="payment" class="form-control" name="payment" data-parsley-required="true"  placeholder="付款说明" value="${obj.product.payment}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="remark" class="col-sm-2 control-label">服务说明</label>
                            
                            <div class="col-sm-8">
                                <input type="text" id="remark" class="form-control" name="remark" data-parsley-required="true"  placeholder="服务说明"  value="${obj.product.remark}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="state" class="col-sm-2 control-label">状态</label>

                            <div class="col-sm-8">
                                 <input type="radio" name="state" data-parsley-required="true" value="1"  <% if(obj.product.state ==1){%>checked="checked"<%}%>/>启用
                                 <input type="radio" name="state" data-parsley-required="true" value="0"  <% if(obj.product.state ==0){%>checked="checked"<%}%>/>禁用
                                 <input type="radio" name="state" data-parsley-required="true" value="-1"  <% if(obj.product.state ==-1){%>checked="checked"<%}%>/>已作废
                            </div>
                        </div>
                    </div>
                </div>
	</div>
	<div class="modal-footer">
		<button  class="btn btn-default btn-sm btn-parsley"  >完成</button> 
	</div>
</form>
<script language="JavaScript">
    $(document).ready(function () {
    	var dialog=$("#editModal");
		$("#editModalDialog").draggable();
        $('#eidtForm').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
            },
            success: function (data, statusText, xhr, form) {
                if (data.code == 0) {
                    Toast.success(data.msg);
                    datatable.ajax.reload();
	               	dialog.modal("hide");
                } else {
                    Toast.error(data.msg);
                    datatable.ajax.reload();
                 	dialog.modal("hide");
                }
            }
        });
    });
</script>
